
import filters from './filter'
import { connect } from './utils/ws-mqtt'
import consts from './consts'
import tools from './utils/tools'
import auth from './utils/auth'
import request from './utils/request'
import SystemEnum from './utils/system-enum'
import components from './components/index'


const vueComponentPlugin = {
  install(Vue) {
    Object.keys(components).forEach(key => {
      Vue.component(components[key].name, components[key])
    })
  }
}

const vueFiltersPlugin = {
  install(Vue) {
    Object.keys(filters).forEach(key => {
      Vue.filter(key, filters[key])
    })
  }
}


export default {
  vueComponentPlugin,
  vueFiltersPlugin,
  ...components,
  connect,
  consts,
  tools,
  auth,
  request,
  SystemEnum
}
